﻿<%@ Page Title="更换银行账号" Language="C#" MasterPageFile="~/member/mMenber.master" AutoEventWireup="true" CodeBehind="ChangeBankInfo.aspx.cs" Inherits="map.member.money.ChangeBankInfo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head2" runat="server">   
    <link href="../../outstyle.css" rel="stylesheet" type="text/css" />
    <script src="../../js/dropdowncontent.js" type="text/javascript"></script>
    <style type ="text/css">
        .MainContentDiv
        {
            width:95%;
            margin:10px 5px 10px 5px;
        }
        .changeAccountDiv
        {
        	border:solid 1px #FFCC33;
         }
         .changeAccountTable
         {
         	border:solid 7px #FFF4C2;
         	padding:3px 3px 3px 3px;
         	width:100%;
         	height:100%;
         }
         .td_w_0
         {
         	width:30%;
         	text-align:right ;
         	vertical-align:top ;
         	padding:2px 0px 2px 0px;  
            line-height:23px;
         }
         .td_w_1
         {
         	width:70%;
         	text-align:left  ;
         	vertical-align:top ;
         	padding:2px 0px 2px 0px;  
            line-height:23px;
         }
         .detailTable
         {
         	vertical-align:top ;
         }
          .SubmitCharge
        {
            background:url(/img/btnTmp_orange.png) no-repeat 0px -35px;
            border:none;
            text-align:center;
            padding-left:20px;
            font-weight:bold ;
            cursor:pointer ;
            width:100px;
            height:35px;
        }
        .td_w_1 span
        {
            color:Blue;
        }
        .validateErrorMsg
        {
            background:url(/img/errorMsg.ico) no-repeat 0px 2px;
            padding-left:20px;
            border:solid 1px red;
            font-size:smaller;
            padding:2px 2px 2px 20px;
            color:Red;
        }
    </style>
    <script type="text/javascript">
        function refreshParentPage() {
            alert("银行账户信息修改成功！");
            if (window.opener != null) {
                window.opener.location.href = window.opener.location.href;
                window.opener = null;
                window.open("", "_self");
                window.close();
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder3" runat="server">
    <div id="MainContentDiv" class="MainContentDiv">
        <h1 style=" padding-left:20px; margin-bottom:4px; font-size:larger;">更改银行账户信息</h1>         
        <hr  /><br/>
        <div class ="changeAccountDiv" >
            <table class="changeAccountTable" width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td style=" vertical-align:top; padding:5px 5px 5px 5px; width:40%">
                        <h1>原来的银行账户信息：</h1>
                        <hr  style=" margin-bottom:5px; margin-top:2px;color:Gray;"/>
                        <table class="detailTable" width="100%" cellpadding="0" cellspacing ="0">
                            <tr>
                                <td class="td_w_0">
                                    开户名：
                                </td>
                                <td class="td_w_1">
                                    <span  ><%= user.BankAccountName  .Value  %>&nbsp;</span>
                                </td>
                            </tr>
                            <tr>
                                <td class="td_w_0">
                                    银行帐号：
                                </td>
                                <td class="td_w_1">
                                    <span  ><%= GetAccountNumber() %>&nbsp;</span>
                                </td>
                            </tr>
                            <tr>
                                <td class="td_w_0">
                                    开户银行名称：
                                </td>
                                <td class="td_w_1">
                                    <span  ><%= user.BankName .Value  %>&nbsp;</span>
                                </td>
                            </tr>
                            <tr>
                                <td class="td_w_0">
                                    支行名称：
                                </td>
                                <td class="td_w_1">
                                    <span  ><%= user.BankBranchName  .Value  %>&nbsp;</span>
                                </td>
                            </tr>
                            <tr>
                                <td class="td_w_0">
                                    帐户类型：
                                </td>
                                <td class="td_w_1">
                                    <span ><%= (user.BankAccountType .Value ==RuleCode .Enum .BankAccountType .CompanyAccount )?"公司账户":"个人账户" %></span>
                                </td>
                            </tr>                             
                        </table>
                    </td>
                    <td style=" width:10%;">
                        <div style=" background:url(/img/reinput_bg.gif) no-repeat -350px 0px; width:100%; height:220px "> &nbsp;
                        </div>
                    </td>
                    <td style=" vertical-align:top;  padding:5px 5px 5px 5px; width:50%">
                        <h1>新的银行帐号信息：</h1>
                        <hr  style=" margin-bottom:5px; margin-top:2px;color:Gray;"/>
                        <table class="detailTable" width="100%" cellpadding="0" cellspacing ="0">
                            <tr>
                                <td class="td_w_0">
                                    开户名：
                                </td>
                                <td class="td_w_1">
                                    <span style=" color:Red ">*</span><input  type="text" id="BankAccountNameInput"  runat="server"/>
                                </td>
                            </tr>
                            <tr>
                                <td class="td_w_0">
                                    银行帐号：
                                </td>
                                <td class="td_w_1">                                       
                                    <span style=" color:Red ">*</span><input title="19位数字"  type="text" id="BankAccountInput" runat="server"/>
                                </td>
                            </tr>     
                            <tr>
                                <td class="td_w_0">
                                    开户银行名称：
                                </td>
                                <td class="td_w_1">
                                    <span style=" color:Red ">*</span><input  type="text" id="BankNameInput" runat="server"/>
                                </td>
                            </tr>
                            <tr>
                                <td class="td_w_0">
                                    支行名称：
                                </td>
                                <td class="td_w_1">
                                    <span style=" color:Red ">*</span><input  type="text" id="BankBranchNameInput" runat="server"/>
                                </td>
                            </tr>
                            <tr>
                                <td class="td_w_0">
                                    帐户类型：
                                </td>
                                <td class="td_w_1">
                                    <span style=" color:Red ">*</span><select id="BankAccountTypeSelect" runat="server">
                                        <option  value="0"  selected ="true">个人账户</option>
                                        <option value="1" >公司账户</option>
                                    </select>
                                </td>
                            </tr>                                                   
                        </table>                         
                    </td>
                </tr> 
                <tr>
                    <td colspan="3" style ="  text-align:center; padding:5px 0px 5px 0px;">
                        <table width="50%"  style=" padding:0px 0px 0px 0px ; margin:0px 0px 0px 0px;">
                            <tr>
                                <td style=" text-align:right; width:40%;">请输入密码：</td>
                                <td style=" text-align:left; width:60%;line-height:30px; vertical-align:top; height:30px;">
                                    <input    type="password" id="password"/>
                                </td>
                            </tr>
                            <tr >
                                <td style=" text-align:right; width:40%; padding-top:15px;">&nbsp;</td>
                                <td style=" text-align:left; width:60%;padding-top:15px;">
                                  <asp:Button ID="changeButton" runat="server" OnClick="saveChange_SeverClick" OnClientClick="return saveChange();" Text="保存更改" CssClass="SubmitCharge" />
                                    <%!--<input id="Button1"  type="button" runat="server" onclick="return saveChange();" title="保存修改银行信息" onserverclick ="saveChange_SeverClick" value ="保存更改" class ="SubmitCharge"/>--%>
                                </td>
                            </tr>
                        </table>
                        
                    </td>
                </tr>
            </table>
            
        </div>
        <div style="border:solid 1px #FFCC33;  width:80%;  padding:4px 4px 4px 20px; margin:15px 5px 5px 0px;">
            <span style="  color:Red; font-size:small;">
            银行账户信息非常重要，请仔细核对后提交修改！
            </span>
        </div>
    </div>

    <script src="../../js/PageValidateUtil.js" type="text/javascript">
        
    </script>
    <script type="text/javascript">
        var idPrefix = "ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder3_";
        function saveChange() {
            var errorCount = PageValidateUtil.initImidValidates(["TextRegexValidate", "TextRegexValidate", "TextRegexValidate", "TextRegexValidate", "CustomerValidate"], [
                                               [idPrefix + "BankAccountNameInput", /^$|^(\s)+$/, "开户名不能为空", "validateErrorMsg", false , 2],
                                               [idPrefix + "BankAccountInput", /^[0-9]{19}$/, "银行账号格式不正确(19位数字)", "validateErrorMsg", true, 1],
                                               [idPrefix + "BankNameInput", /^$|^(\s)+$/, "开户银行名称不能为空", "validateErrorMsg", false, 2],
                                               [idPrefix + "BankBranchNameInput", /^$|^(\s)+$/, "支行名称不能为空", "validateErrorMsg", false, 2],
                                               ["password", validatePassword, "密码不正确", "validateErrorMsg", 1]
                                               ]);
            return (errorCount <= 0);
        }

        function initMainContentDiv() {
            var mainConentDiv = document.getElementById("MainContentDiv");
            if (parseInt(mainConentDiv.scrollWidth) < 650) {
                mainConentDiv.style.width = "650px";
            }
        }
        //initMainContentDiv();
        function validatePassword() {
            var password = document.getElementById("password").value;
            var result = AjaxFunction.ValidatePassword("", password);
            if (result.value != null && result.value == true)
                return true;
            return false;
        }
        PageValidateUtil.initFocusValidates([ "CustomerValidate"], [
                            ["password", validatePassword, "密码不正确", "validateErrorMsg", 2]]);
    </script>
</asp:Content>
